import request from '@/utils/request';

/**
 * 要素信息分页列表查询
 * @param {*} reqWrapperData 
 * @returns 
 */
export function pageList(reqWrapperData) {
    const {query, data} = reqWrapperData
  return request({
    url: '/datastandard/feature/list',
    method: 'post',
    headers: {'X-HTTP-Method-Override': 'GET'},
    params: {
        page:query.page,
        pageSize:query.pageSize
    },
    data:{
        // id:data.id,
        // featureName:data.featureName,
        featureCName:data.featureCName,
        // geometryType:data.geometryType,
        businessType:data.businessType,
        // updateMethod:data.updateMethod,
        // updateRate:data.updateRate,
        // featureDesc:data.featureDesc
    }
  });
}

/**
 * 添加一个新的要素信息
 * @param {*} reqWrapperData 
 * @returns 
 */
export function addOne(reqWrapperData) {
  const {data} = reqWrapperData
  return request({
    url: '/datastandard/feature/add',
    method: 'post',
    data:{
        id:null,
        featureName:data.featureName,
        featureCName:data.featureCName,
        isGeometry:data.isGeometry,
        geometryType:data.geometryType,
        businessType:data.businessType,
        updateMethod:data.updateMethod,
        updateRate:data.updateRate,
        featureDesc:data.featureDesc
    }
  });
}


/**
 * 修改一个新的要素信息
 * @param {*} reqWrapperData 
 * @returns 
 */
 export function updateOne(reqWrapperData) {
  const {data} = reqWrapperData
  return request({
    url: '/datastandard/feature/update',
    method: 'put',
    data:{
        id:data.id,
        featureName:data.featureName,
        featureCName:data.featureCName,
        isGeometry:data.isGeometry,
        geometryType:data.geometryType,
        businessType:data.businessType,
        updateMethod:data.updateMethod,
        updateRate:data.updateRate,
        featureDesc:data.featureDesc
    }
  });
}


/**
 * 修改一个要素信息
 * @param {*} reqWrapperData 
 * @returns 
 */
export function deleteOne(reqWrapperData) {
  const {query} = reqWrapperData
  return request({
    url: '/datastandard/feature/delete',
    method: 'delete',
    params:{
      id:query.id
    }
  });
}